package com.gyg.service;

import com.gyg.domain.CloudUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gyg.returns.RespEntity;
import com.gyg.vo.param.LoginParam;
import com.gyg.vo.param.RegisterParam;
import com.gyg.vo.param.UserParam;
import com.gyg.vo.param.UserPwdParam;

/**
 * <p>
 * 用户信息表 服务类
 * </p>
 *
 * @author gyg
 * @since 2021-02-20
 */
public interface CloudUserService extends IService<CloudUser> {

    /**
     * 校验账号是否已经被注册
     * @param username
     * @return
     */
    RespEntity checkUsername(String username);

    /**
     * 新用户注册
     * @param registerParam
     * @return
     */
    RespEntity register(RegisterParam registerParam);

    /**
     * 用户登陆
     * @param loginParam
     * @return
     */
    RespEntity<CloudUser> login(LoginParam loginParam);

    /**
     * 编辑个人信息
     * @param userParam
     * @return
     */
    RespEntity updateUser(UserParam userParam);

    /**
     * 校验旧密码
     * @param userPwdParam
     * @return
     */
    RespEntity<Boolean> checkPassword(UserPwdParam userPwdParam);

    /**
     * 修改密码
     * @param userPwdParam
     * @return
     */
    RespEntity updatePassword(UserPwdParam userPwdParam);

    /**
     * 用户信息
     * @param userId
     * @return
     */
    RespEntity<CloudUser> userInfo(Integer userId);
}
